home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / XAMPP 1.4.14 / xampp-win32-1.4.14-installer.exe / xampp / php / pear / DB / QueryTool / Result / Object.php
PHP Script  |  2004-10-01  |  2KB  |  76 lines

  1. <?php
  2. // +----------------------------------------------------------------------+
  3. // | PHP Version 4                                                        |
  4. // +----------------------------------------------------------------------+
  5. // | Copyright (c) 1997-2003 The PHP Group                                |
  6. // +----------------------------------------------------------------------+
  7. // | This source file is subject to version 2.02 of the PHP license,      |
  8. // | that is bundled with this package in the file LICENSE, and is        |
  9. // | available at through the world-wide-web at                           |
  10. // | http://www.php.net/license/2_02.txt.                                 |
  11. // | If you did not receive a copy of the PHP license and are unable to   |
  12. // | obtain it through the world-wide-web, please send a note to          |
  13. // | license@php.net so we can mail you a copy immediately.               |
  14. // +----------------------------------------------------------------------+
  15. // | Author:  Roman Dostovalov, Com-tec-so S.A.<roman.dostovalov@ctco.lv> |
  16. // +----------------------------------------------------------------------+
  17. //
  18. // $Id: Object.php,v 1.2 2004/04/27 23:39:16 quipo Exp $
  19. //
  20.  
  21. /**
  22.  * Include parent class
  23.  */
  24. require_once 'DB/QueryTool/Result.php';
  25.  
  26. // ------------------------------------------------------------------------
  27.  
  28. /**
  29.  *    Result row class
  30.  */
  31. class DB_QueryTool_Result_Row
  32. {
  33.     /**
  34.      * create object properties from the array
  35.      * @param array
  36.      */
  37.     function DB_QueryTool_Result_Row($arr)
  38.     {
  39.         foreach ($arr as $key => $value) {
  40.             $this->$key = $value;
  41.         }
  42.     }
  43. }
  44.  
  45. // ------------------------------------------------------------------------
  46.  
  47. /**
  48.  * @package    DB_QueryTool
  49.  * @access     public
  50.  * @author     Roman Dostovalov <roman.dostovalov@ctco.lv>
  51.  */
  52. class DB_QueryTool_Result_Object extends DB_QueryTool_Result
  53. {
  54.     // {{{ fetchRow
  55.  
  56.     /**
  57.      * This function emulates PEAR_DB function FetchRow
  58.      * With this function DB_QueryTool can transparently replace PEAR_DB
  59.      *
  60.      * @todo implement fetchmode support?
  61.      * @access    public
  62.      * @return    void
  63.      */
  64.     function fetchRow()
  65.     {
  66.         $arr = $this->getNext();
  67.         if (!PEAR::isError($arr)) {
  68.             $row = new DB_QueryTool_Result_Row($arr);
  69.             return $row;
  70.         }
  71.         return false;
  72.     }
  73.  
  74.     // }}}
  75. }
  76. ?>